  <h2>
    Using Classic Rails 4.2 "generate scaffold"
  </h2>

<div class="prose max-w-full prose-a:text-sky-700 prose-li:my-0 prose-code:text-rose-600 prose-code:bg-yellow-100 prose-headings:text-gray-700">
  <% if notice %>
    <p id="notice" class="bg-success bg-green-100 px-6 py-4"><%= notice %></p>
  <% end %>

  <h2>Listing Comments</h2>

  <table data-turbo="true">
    <thead>
      <tr>
        <th>Author</th>
        <th>Text</th>
        <th></th>
      </tr>
    </thead>

    <tbody>
      <% @comments.each do |comment| %>
        <tr>
          <td><%= comment.author %></td>
          <td><%= markdown_to_html(comment.text) %></td>
          <td class="flex flex-col lg:flex-row gap-2">
            <%= link_to 'Show', comment %>
            <%= link_to 'Edit', edit_comment_path(comment) %>
            <%= button_to 'Destroy', comment, method: :delete, data: { turbo_confirm: 'Are you sure?' }, class: "text-red-500 cursor-pointer" %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>

  <%= link_to 'New Comment', new_comment_path, class: "not-prose px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800" %>
</div>
